﻿<?php
	include ("../connect.php"); 
	if(($_GET['theloai'])!="nhung"){
		$tl = $_GET['theloai'];
	$sql="SELECT * FROM muc_tin WHERE MS_LOAI_TIN= ".$_GET['theloai']." ORDER BY MS_MUC_TIN";
	$rs=mysql_query($sql);
?>
<form name="frmdsmt">
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="ds_muc_tin" class="table">
  <tr>
  	<td>
	</td>
  </tr>
  <tr>
    <td colspan="5"><h2><b>Danh Sách Mục Tin</b></h2></td>
  </tr>
  <tr>
    <td align="center" class="title_left">STT</td>
    <td align="center" class="title_row">MÃ SỐ MỤC TIN</td>
	<td align="center" class="title_row">TÊN MỤC TIN</td>
    <td align="center" class="title_row"><font color="#00FF00">Sửa</font></td>
    <td align="center" class="title_row"><font color="#FF0000">Xóa</font></td>
  </tr>
<?php
	$i=0;
	while($rw=mysql_fetch_array($rs)){
		$i++;					
?>
  <tr>
    <td class="stt"><?php  echo $i; ?></td>
    <td class="data_row"><?php echo $rw['MS_MUC_TIN'] ?>&nbsp;</td>
    <td class="data_row"><?php echo $rw['TEN_MUC_TIN'] ?>&nbsp;</td>
    <td class="data_row"><img src="images/edit.gif" border="0" onClick="mo_form_sua('<?php echo $rw['MS_MUC_TIN'];?>')"/></td>
    <td class="data_row"><input type="checkbox" name="chkxoa" value="<?php echo $rw['MS_MUC_TIN']; ?>  " /></td>
  </tr>
<?php
	} }
?>
	<tr>
  		<td height="20" align="center" colspan="9"><b>Tổng số mục tin: <?php echo mysql_num_rows($rs) ?></b></td>
  	</tr>
</table>
</form><br />
<div align="center">
<input type="button" name="them" id="them" value="Thêm mục tin" onclick="location.href='index.php?noidung=tmt&mt=<?php echo $tl?>'" class="button"/>&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" name="xoa" id="xoa" value="Xóa" onClick="thuchienxoa()" class="button"/>
</div>
<form name="frmDLxoa" action="muc_tin/xoa_muc_tin.php" method="post">
<input type="hidden" name="ms_muc_tin" value=""/>
</form>
<form name="frmDLsua" method="post" action="index.php?noidung=smt">
<input type="hidden" name="ms_muc_tin" value="">
</form>